package com.newhero.security;

import java.io.Serializable;

import com.newhero.product.common.util.GTime;

public class NewheroLicense implements Serializable
{
    /**
     * 
     */
    private static final long serialVersionUID = -4513523134925252021L;
    private String thisMacAddr = "";
    private byte[] thisLicense;
    @SuppressWarnings("unused")
	private String license;
    private int thisModel;//0:三员分立，1：市级三员分立不设立审计员，2：不设立独立三员
    @SuppressWarnings("unused")
	private String thisDate;//系统有效期
    @SuppressWarnings("unused")
	private int thisDept;//单位数
    @SuppressWarnings("unused")
	private int thisUser;//用户数
    private static NewheroLicense instance = new NewheroLicense();
    
    private NewheroLicense()
    {
        this.thisLicense = null;
        this.thisModel = 2;
        this.thisMacAddr = "";
        this.thisDate = GTime.getTime(GTime.YYYYMMDD);
        this.thisDept = 5;
        this.thisUser = 10;
    }
    
    public void initLicense(byte[] license)
    {
        this.thisMacAddr = MacAddressUtil.getMacAddress();
        this.thisLicense = license;
    }
    
    public static NewheroLicense getInstance()
    {
        return instance;
    }
    
    /**
     * @return the thisMacAddr
     */
    public String getThisMacAddr()
    {
        return thisMacAddr;
    }
    
    public boolean macAddrIsNotNull()
    {
        return thisMacAddr!=null && !thisMacAddr.equals("");
    }
    /**
     * @param thisMacAddr the thisMacAddr to set
     */
    /*
    public void setThisMacAddr(String thisMacAddr)
    {
        this.thisMacAddr = thisMacAddr;
    }
    */
    
    /**
     * @return the thisLicense
     */
    public byte[] getThisLicense()
    {
        return thisLicense;
    }
    /**
     * @param thisLicense the thisLicense to set
     */
    /*
    public void setThisLicense(byte[] thisLicense)
    {
        this.thisLicense = thisLicense;
    }
    */
	public int getThisModel() {
		return thisModel;
	}

	public void setThisModel(int thisModel) {
		this.thisModel = thisModel;
	}
	/*
	public String getThisDate() {
		return thisDate;
	}

	public void setThisDate(String thisDate) {
		this.thisDate = thisDate;
	}

	public int getThisDept() {
		return thisDept;
	}

	public void setThisDept(int thisDept) {
		this.thisDept = thisDept;
	}

	public int getThisUser() {
		return thisUser;
	}

	public void setThisUser(int thisUser) {
		this.thisUser = thisUser;
	}
	*/
}